<!--
  Copyright 2017-2018 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<div class="card">
  <div class="card-header">
    <h2>General</h2>
  </div>
  <div class="card-body">
    <div ng-hide="hideMainContent()">
      <div ng-include src="'template/gt-loading-overlay.html'"></div>
      <div ng-include src="'template/gt-http-error-overlay.html'"></div>
      <!-- intentionally not using gt-form-autofocus-on-first-input as it doesn't make the most sense on this form -->
      <div ng-form
           name="formCtrl"
           style="padding-top: 15px;">
        <div gt-form-group
             gt-label="Agent{{ isAgentRollup() ? ' rollup' : '' }} ID"
             gt-model="agentRollupId"
             gt-disabled="true"
             gt-width="40em">
          <div class="help-block">
            Cannot be changed, used for storing and querying the agent{{ isAgentRollup() ? ' rollup' : '' }}'s data.
          </div>
        </div>
        <div gt-form-group
             gt-label="Display name"
             gt-model="config.display"
             gt-disabled="!agentRollup.permissions.config.edit.general"
             gt-width="40em"
             gt-placeholder="{{config.defaultDisplay}}">
          <div class="help-block">
            Display name for this agent{{ isAgentRollup() ? ' rollup' : '' }}.
          </div>
        </div>
        <div class="form-group" ng-if="isAgentRollup()">
          <div class="offset-xl-3 col-xl-9 help-block">
            <em>NOTE: the agent rollup configuration (synthetic monitors, alerts, UI and advanced) applies directly to
              the agent rollup data. This configuration has no affect on individual agents under the rollup.</em>
          </div>
        </div>
        <div class="form-group row"
             ng-if="agentRollup.permissions.config.edit.general">
          <div class="offset-xl-3 col-xl-9">
            <div gt-button
                 gt-label="Save changes"
                 gt-click="save(deferred)"
                 gt-validate-form="formCtrl"
                 class="d-inline-block">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!-- each page with confirmation dialog needs its own confirmation dom so that it is deleted on $destroy -->
<div ng-include="'template/gt-confirmation.html'"></div>
